<!-- target: contract -->
<div class="contract-detail-page detail-page flex-cont" ui="type:m-panel;">
    <div class="detail-info staff-info">
        <!-- if: ${detail.contractInfo.headPortrait} -->
        <img src="={${detail.contractInfo.headPortrait}" alt="">
        <!-- elif: ${detail} -->
        <!-- var: name = String.prototype.slice.call(${detail.contractInfo.delegateStaffName}, -2) -->
        <div class="head">${name}</div>
        <!-- /if -->
        <div class="text">
            <div class="name">${detail.contractInfo.delegateStaffName}</div>
            <div class="status">${detail.contractInfo.auditStateDesc}</div>
        </div>
        <img class="audit-state" src="images/approval/auditState_${detail.contractInfo.auditState}.png" />
    </div>
    <ul class="detail-info info-list">
        <li class="info-item">
            <div class="info-label">合同编号：</div>
            <div class="info-text">[${detail.contractInfo.contractNo}]</div>
        </li>
        <li class="info-item">
            <div class="info-label">所在部门：</div>
            <div class="info-text">[${detail.deptName}]</div>
        </li>
        <li class="info-item">
            <div class="info-label">项目名称：</div>
            <div class="info-text">[${detail.contractInfo.projectName}]</div>
        </li>
        <li class="info-item">
            <div class="info-label">预订场馆：</div>
            <div class="info-text">[${detail.contractInfo.venueName}]</div>
        </li>
        <li class="info-item">
            <div class="info-label">开始时间：</div>
            <div class="info-text">[${detail.contractInfo.startTime|dateFormat('yyyy-MM-dd HH:mm:ss')}]</div>
        </li>
        <li class="info-item">
            <div class="info-label">结束时间：</div>
            <div class="info-text">[${detail.contractInfo.endTime|dateFormat('yyyy-MM-dd HH:mm:ss')}]</div>
        </li>
        <li class="info-item">
            <div class="info-label">签约地点：</div>
            <div class="info-text">[${detail.contractInfo.signContractPlace}]</div>
        </li>
        <li class="info-item">
            <div class="info-label">签约时间：</div>
            <div class="info-text">[${detail.contractInfo.signContractTime|dateFormat('yyyy-MM-dd HH:mm:ss')}]</div>
        </li>
        <!-- if: ${detail.pics.length} -->
        <li class="info-item">
            <div class="info-label">图片：</div>
            <div class="info-text img">
                <!-- for: ${detail.pics} as ${item} -->
                <img src="${item.imageUrl}" />
                <!-- /for -->
            </div>
        </li>
        <!-- /if -->
    </ul>

    <!-- use:detail.contactInfo(detail=${detail.contractInfo}) -->
    <!-- use:detail.business(detail=${detail.contractInfo}) -->

    <!-- if:${detail.contractInfo.drinksDivision} === 2 -->
    <!-- use:detail.drink(detail=${detail.contractInfo}) -->
    <!-- /if -->

    <!-- use:detail.other(detail=${detail.contractInfo}) -->

    <!-- use:detail.ticket(detail=${detail.contractInfo}) -->
    <!-- use:detail.histories(histories=${detail.contractInfo.histories}) -->

</div>
<!-- use:detail.contractComment(detail=${detail.contractInfo},module=2,initiate=${initiate}) -->

<!-- target:contractComment -->
<!-- var:auditState = ${detail.auditState} !== undefined ? ${detail.auditState} : ${detail.contractInfo.auditState}; -->
<form class="operate-btn-box" name="contractCommentForm">
    <input class="ui-hide" name="id" value="${detail.id}" />
    <input class="ui-hide" name="action" value="" />
    <label ui="type:NS.ContractCommentSave;name:actionRemark;">
        <input class="text" type="text" placeholder="请输入" name="actionRemark" />
        <input class="submit-btn" type="button" disabled value="提交"/>
        <div class="btn-items">

            <!-- if: ${auditState} === 1 -->
                <!-- if: ${mao.staffInfo.storeManager} || ${mao.staffInfo.staffId} === ${detail.contractInfo.creatorId} -->
                <strong type="text" class="btn-item" ui="ext-permission:={mao.joinPermission(${module}, 'modify')};module:${module};action:0"><span class="icon more"></span><span>撤销</span></strong>
                <!-- /if -->
                <!-- if: ${detail.auditNode} === 1 -->
                <strong type="text" class="btn-item" ui="ext-permission:={mao.joinPermission(${module}, 'auditFirst')};module:${module};action:3"><span class="icon more"></span><span>通过</span></strong>
                <strong type="text" class="btn-item" ui="ext-permission:={mao.joinPermission(${module}, 'auditFirst')};module:${module};action:2"><span class="icon more"></span><span>驳回</span></strong>
                <!-- elif: ${detail.auditNode} === 2 -->
                <strong type="text" class="btn-item" ui="ext-permission:={mao.joinPermission(${module}, 'auditFinal')};module:${module};action:3"><span class="icon more"></span><span>通过</span></strong>
                <strong type="text" class="btn-item" ui="ext-permission:={mao.joinPermission(${module}, 'auditFinal')};module:${module};action:2"><span class="icon more"></span><span>驳回</span></strong>
                <!-- /if -->
            <!-- elif: ${auditState} === 0 || ${auditState} === 2 -->
                <!-- if: ${mao.staffInfo.storeManager} || ${mao.staffInfo.staffId} === ${detail.contractInfo.creatorId} -->
                <!-- <a class="btn-item" href="#/venueOrder/edit~id=${detail.id}" ui="ext-permission:={mao.joinPermission(${module}, 'modify')};module:${module};action:5">编辑</a> -->
                <strong type="text" class="btn-item" ui="ext-permission:={mao.joinPermission(${module}, 'modify')};module:${module};action:6"><span class="icon more"></span><span>删除</span></strong>
                <!-- /if -->
            <!-- elif: ${auditState} === 3 -->
            <strong type="text" class="btn-item" ui="ext-permission:={mao.joinPermission(${module}, 'auditFinal')};module:${module};action:4"><span class="icon more"></span><span>终止</span></strong>
            <!-- /if -->
            
            <strong type="text" class="btn-item" ui="module:${module};action:7"><span class="icon"></span><span>评论</span></strong>
        </div>
    </label>
</form>
